package com.wyc.apidriver.controller;

import com.wyc.apidriver.service.VerificationCodeService;
import com.wyc.internalCommon.request.VerificationCodeDTO;
import com.wyc.internalCommon.result.ApiResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 司机操作验证码
 */
@RestController
public class VerificationCodeController {

    @Autowired
    private VerificationCodeService verificationCodeService;

    /**
     * 司机获取验证码
     * @param verificationCodeDTO
     * @return
     */
    @PostMapping("/verification-code")
    public ApiResult verificationCode(@RequestBody VerificationCodeDTO verificationCodeDTO){
        return verificationCodeService.sendVerificationCode(verificationCodeDTO);
    }

    /**
     * 司机校验验证码
     * @param verificationCodeDTO
     * @return
     */
    @PostMapping("/verification-code-check")
    public ApiResult checkVerificationCode(@RequestBody VerificationCodeDTO verificationCodeDTO){
        return verificationCodeService.checkVerificationCode(verificationCodeDTO);
    }

}
